package com.njchy.statistics.entity.vo;

import lombok.Data;

import java.math.BigDecimal;

@Data
public class RangeStatVO {
    private String range;
    private int count; // 区间内有效数据的个数
    private BigDecimal diffSum; // 区间内有效数据的差值总和

    public RangeStatVO(String range) {
        this.range = range;
        this.count = 0;
        this.diffSum = BigDecimal.ZERO;
    }

    public void incrementCount() {
        this.count++;
    }

    public void addToDiffSum(BigDecimal diff) {
        this.diffSum = this.diffSum.add(diff);
    }

    public String getRange() {
        return range;
    }

    public int getCount() {
        return count;
    }

    public BigDecimal getDiffSum() {
        return diffSum;
    }
}
